function showLoading(msg)
{
	if(!isNotNull(msg))
	{
		msg = '正在加载数据，请稍候...';
	}
	var html = '<div id="loadingDiv" style="position:absolute; background-color:white; border-style:solid; border-width:1px; border-color:lightblue;">';
	html += '<table><tr><td><img src="' + realPath + '/common/loading/spinner.gif" /></td><td style="overflow:visible;">' + msg + '</td></tr></table>';
	html += '</div>';
	$('BODY').append(html);
	var loadingDiv = $('#loadingDiv');
	var width = parseInt(loadingDiv.width());
	var winWidth = parseInt($(window).width());
	var winHeight = parseInt($(window).height());
	var left = (winWidth - width) / 2;
	var top = winHeight / 2 - 10;
	loadingDiv.css({'left': left, 'top':top});
	setLoadingPosition();
}

function hideLoading()
{
	var loadingDiv = $('#loadingDiv');
	if(loadingDiv.length > 0)
	{
		loadingDiv.remove();
	}
}

function setLoadingPosition()
{
	var loadingDiv = $('#loadingDiv');
	if(loadingDiv.length > 0)
	{
		var width = parseInt(loadingDiv.width());
		var winWidth = parseInt($(window).width());
		var winHeight = parseInt($(window).height());
		var left = (winWidth - width) / 2;
		var top = winHeight / 2 - 10;
		loadingDiv.css({'left': left, 'top':top});
	}
	setTimeout('setLoadingPosition()', 500);
}

